package com.duck.inspection.service.impl;

import com.duck.inspection.dao.MarketDao;
import com.duck.inspection.domain.po.ProductPojo;
import com.duck.inspection.service.MarketService;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class MarketServiceImpl implements MarketService
{
    @Autowired
    private MarketDao marketDao;
    @Override
    public List<String> getMarketIndex()
    {
        return marketDao.getMarketIndex();
    }

//    @Override
//    public List<ProductPojo> getMarketProductByIdx(Integer idxId)
//    {
//        return marketDao.getMarketProductByIdx(idxId);
//    }

    @Override
    public List<ProductPojo> getMarketProductByIdx(Integer idxId)
    {
        return marketDao.getMarketProductByIdx(idxId);
    }

    @Override
    public List<ProductPojo> getMarketProductByDateRange(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate)
    {
        return marketDao.getMarketProductByDateRange(startDate, endDate);
    }
}
